load("@rules_java//java:defs.bzl", "java_library")

package(
    default_applicable_licenses = ["//:license"],
    default_visibility = [
        "//optimizer/optimizers:__pkg__",
        "//publish:__pkg__",
    ],
)

java_library(
    name = "constant_folding",
    srcs = [
        "ConstantFoldingOptimizer.java",
    ],
    tags = [
    ],
    deps = [
        ":default_optimizer_constants",
        "//:auto_value",
        "//bundle:cel",
        "//common:cel_ast",
        "//common:cel_source",
        "//common:compiler_common",
        "//common:mutable_ast",
        "//common/ast",
        "//common/ast:mutable_expr",
        "//common/navigation:mutable_navigation",
        "//extensions:optional_library",
        "//optimizer:ast_optimizer",
        "//optimizer:mutable_ast",
        "//optimizer:optimization_exception",
        "//parser:operator",
        "//runtime",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "common_subexpression_elimination",
    srcs = [
        "SubexpressionOptimizer.java",
    ],
    tags = [
    ],
    deps = [
        ":default_optimizer_constants",
        "//:auto_value",
        "//bundle:cel",
        "//common:cel_ast",
        "//common:cel_source",
        "//common:compiler_common",
        "//common:mutable_ast",
        "//common:mutable_source",
        "//common/ast",
        "//common/ast:mutable_expr",
        "//common/navigation",
        "//common/navigation:common",
        "//common/navigation:mutable_navigation",
        "//common/types",
        "//common/types:type_providers",
        "//optimizer:ast_optimizer",
        "//optimizer:mutable_ast",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
        "@maven//:org_jspecify_jspecify",
    ],
)

java_library(
    name = "default_optimizer_constants",
    srcs = [
        "DefaultOptimizerConstants.java",
    ],
    visibility = ["//visibility:private"],
    deps = [
        "//checker:standard_decl",
        "//extensions",
        "//extensions:optional_library",
        "//parser:operator",
        "@maven//:com_google_guava_guava",
    ],
)
